<div class="tab f14 mt15 clearfix">
    <div tabs="followingTabs" tabs-curr="curr_following_tab"></div>
    <div class="tab-bottom-line"></div>
</div>
<div class="search mt15 clearfix">
    <div style="width:113px" class="fl">
        <div class="select" ui-combobox data="searchType"
             ng-model="query.searchField" text-field="text" value-field="value">
        </div>
    </div>
    <input type="text" name="" class="input-text mr5 fl" value="" ng-enter="getSimpleList()"
           ng-model="query.searchValue" style="width: 366px;">
    <a class="btn" ng-click="getSimpleList()">搜索</a>
</div>
<!--无效客户-->
<div class="table-header mt20 clearfix">
    <span class="fl lh30 f14">无效客户列表</span>
    <div ng-show="checkAll">
        <div class="fl lh30 ml25 f14" style="padding-top: 3px;" >
            <label class="checkbox">
                <input type="checkbox" ng-model="checkCountAll" ng-change="checkAllChange(tableList.list, checkAll = checkCountAll)">
                <span style="font-size: 14px;">选中全部</span>
            </label>
        </div>
        <span class="fl lh30 ml10 f14" ng-show="checkCountAll">已经选中<span class="c-orange">{{tableList.total}}</span>条记录</span>
    </div>
    <div class="fr btn-group">
        <a href="javascript: void(0)" class="btn fl permission p-50020305-21"
           ng-show="!hasBindErp"
           ui-dialog="批量修改"
           ui-dialog-url="inc/dialog/edit_status.html"
           ui-dialog-cache="false"
           ui-dialog-before-show="hasCheck(tableList.list)"
           ui-dialog-ok="changeAllStages(curProjectId,getCheckList(tableList.list),$dialogScope,getList)">批量修改</a>
        <a href="javascript: void(0)" class="btn fl permission p-50020305-11"
           ui-dialog="客户分配"
           ui-dialog-url="inc/dialog/distribution.html"
           ui-dialog-cache="false"
           ui-dialog-before-show="hasCheck(tableList.list)"
           ui-dialog-init="assignCustomerService.init(curProjectId,$dialogScope)"
           ui-dialog-ok="assignCustomerService.assignAllCustomer(curProjectId,getCheckList(tableList.list),$dialogScope,getList,checkCountAll,parseQueryParams(query,queryType),2,tableList.total)">批量分配</a>
        <a href="javascript: void(0)" class="btn fl permission p-50020305-12"
           ui-dialog="客户回收"
           ui-dialog-url="inc/dialog/return_customer.html"
           ui-dialog-cache="false"
           ui-dialog-before-show="hasCheck(tableList.list)"
           ui-dialog-init="recoverCustomerService.initAll(getCheckList(tableList.list),$dialogScope,checkCountAll,tableList.total)"
           ui-dialog-ok="recoverCustomerService.recoverAllCustomer(curProjectId,getCheckList(tableList.list),$dialogScope,getList,checkCountAll,parseQueryParams(query,queryType),2,tableList.total)">批量回收</a>

        <div class="fl import_btn relative">
            <a href="javascript: void(0)" class="btn btn-yellow permission p-50020305-26 p-50020305-13 p-50020305-22">线下分配</a>

            <div class="top-userinfo-menu text-center" style="z-index: 100;top: 25px;left:-7px;">
                <div class="top-userinfo-menu-list">
                    <a href="javascript:;" class="permission p-50020305-13-inline-block" ng-click="export(tableList.total,parseQueryParams(query, queryType),2)" style="width: 100%;">导出客户资料</a>
                    <a href="javascript:;"
                       class="permission p-50020305-22-inline-block"
                       ui-dialog="导入分配结果"
                       ui-dialog-data=""
                       ui-dialog-before-show="beforeImportCustomer($dialog,$dialogScope,$data,getList)"
                       ui-dialog-show="uploadCustomer($dialog)"
                       ui-cancel-value="取消"
                       ui-dialog-cache="false"
                       ui-dialog-url="inc/dialog/upload_assign.html">导入分配结果</a>
                </div>
                <i class="top-userinfo-menu-arrow"></i>
            </div>
        </div>
    </div>
</div>
<div id="grid" class="table-wrap text-center mt10">
    <table width="100%" style="line-height: 22px;">
        <thead>
        <tr>
            <th style="padding-top: 3px;">
                <label class="checkbox">
                    <input type="checkbox" ng-model="checkAll" ng-change="checkAllChange(tableList.list, checkAll)">
                    <span>序号</span>
                </label>
            </th>
            <th class="text-center">姓名</th>
            <th class="text-center">电话</th>
            <th class="text-center">业务员</th>
            <th class="text-center">客户状态</th>
            <th class="text-center" width="180">无效原因</th>
            <th class="text-center">意向级别</th>
            <th class="text-center" style="cursor: pointer;" ng-click="query.sort_order = (query.sort_order === 'desc' ? 'asc':'desc');getList()">
                最近跟进时间
                <a class="ml5">
                    <i class="sort_icon" ng-class="{sort_down:query.sort_order === 'desc',sort_up:query.sort_order === 'asc'}"></i>
                </a>
            </th>
            <th class="text-center">跟进方式</th>
            <th class="text-center">操作<a class="fr ml15 c-orange mr5" ng-click="getList()"><i
                    class="freshen"></i></a></th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="row in tableList.list">
            <td height="34" style="text-align: left;">
                <label class="checkbox">
                    <input type="checkbox" ng-model="row.checked" ng-change="checkChange(tableList.list)">
                    <span>{{(query.page_index-1)*query.page_size+$index+1}}</span>
                </label>
            </td>
            <td>{{row.cst_name}}</td>
            <td style="text-align: left;" title="{{row.comms_all}}">{{row.comms_all | firstComma}}</td>
            <td class="">{{row.user_name}}</td>
            <td>{{row.stage_id_text}}</td>
            <td>{{row.lose_reason_text}}</td>
            <td>{{row.follow_level_text}}</td>
            <td>{{row.last_date | myDateFormat:'yyyy-MM-dd HH:mm'}}</td>
            <td>{{row.gjfs_text}}</td>
            <td>
                <a class="c-orange mr5"
                   ui-dialog="查看客户"
                   ui-dialog-url="inc/dialog/customer_view.html"
                   ui-dialog-cache="false"
                   ui-dialog-init="cstInfoService.init(row.proj_id,row.cst_id,$dialogScope)"
                   ui-dialog-ok="">查看</a>
                <a class="c-orange mr5 permission p-50020305-11-inline"
                   ui-dialog="客户分配"
                   ui-dialog-url="inc/dialog/distribution.html"
                   ui-dialog-cache="false"
                   ui-dialog-init="assignCustomerService.init(row.proj_id,$dialogScope)"
                   ui-dialog-ok="assignCustomerService.assignCustomer(row.proj_id,row.opp_id,$dialogScope,getList)">分配</a>
                <a class="c-orange mr5 permission p-50020305-12-inline"
                   ui-dialog="客户回收"
                   ui-dialog-url="inc/dialog/return_customer.html"
                   ui-dialog-cache="false"
                   ui-dialog-before-show="recoverCustomerService.init(row)"
                   ui-dialog-ok="recoverCustomerService.recoverCustomer(row.proj_id,row.opp_id,$dialogScope,getList)">回收</a>
                <a class="c-orange mr5 permission p-50020305-21-inline"
                   ui-dialog="编辑客户"
                   ui-dialog-url="inc/dialog/edit_customer.html"
                   ui-dialog-cache="false"
                   ui-dialog-init="editCstInfoService.init(row.proj_id,row.cst_id,$dialogScope,hasBindErp)"
                   ui-dialog-ok="editCstInfoService.save(row.proj_id,row.cst_id,row.opp_id,$dialogScope,$dialog,getList)">编辑</a>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="no-data  ng-hide" ng-show="tableList.list && tableList.list.length<1">
        <span>暂无数据</span>
    </div>
</div>
<div ui-pagination page-index="query.page_index" page-size="query.page_size" total="tableList.total"
     class="mt10" changed="getList($pageIndex)"></div>
<!--无效客户-->
